<?php

namespace app\api\model\employ;

use app\common\model\employ\Employ as EmployModel;
use think\facade\Cache;

class Employ extends EmployModel
{


    public function add($user, $data)
    {
        $cityInfo = Cache::get($user['user_id'] . '_mycity_numid');

        if (empty($cityInfo)) {
            $this->error = "请先切换到您要应聘的城市";
            return false;
        }
        $shop_supplier_id = Cache::get($user['user_id'] . '_shop_supplier_id');
        $data["province_id"] = $cityInfo[0];
        $data["city_id"] = $cityInfo[1];
        $data["app_id"] = self::$app_id;
        $data["shop_supplier_id"] = $shop_supplier_id ?: 0;
        return $this->save($data);
    }
}